home *** CD-ROM | disk | FTP | other *** search
/ Java for 3D & VRML Worlds / Java for 3d and VRML Worlds.iso / examples / chap04 / Transparency.wrl < prev    next >
Text File  |  1996-10-14  |  2KB  |  68 lines

  1. #VRML V2.0 utf8
  2.  
  3. # window which you cannot go through.
  4. Transform{
  5.         translation 0 -5 0
  6.         children[
  7.         Shape{
  8.                 geometry IndexedFaceSet{
  9.                         coord Coordinate{
  10.                                 point[  
  11.                                         0 0 0,          #0
  12.                                         10 0 0,         #1
  13.                                         10 10 0,        #2
  14.                                         0 10 0,         #3
  15.                                 ]
  16.                         }
  17.                         coordIndex [0, 1, 2, 3, -1]
  18.                 }
  19.                 appearance Appearance{
  20.                         material Material{
  21.                                 diffuseColor 1 0 0
  22.                                 transparency 0.7
  23.                         }
  24.                 }
  25.         }
  26.         ]
  27. }
  28.  
  29. # window which you can go through.
  30. Transform{
  31.         translation -10 -5 0
  32.         children[
  33.         Collision{
  34.                 collide FALSE
  35.                 children[
  36.                 Shape{
  37.                         geometry IndexedFaceSet{
  38.                                 coord Coordinate{
  39.                                         point[  
  40.                                                 0 0 0,          #0
  41.                                                 10 0 0,         #1
  42.                                                 10 10 0,        #2
  43.                                                 0 10 0,         #3
  44.                                         ]
  45.                                 }
  46.                                 coordIndex [0, 1, 2, 3, -1]
  47.                         }
  48.                         appearance Appearance{
  49.                                 material Material{
  50.                                         diffuseColor 0 1 0
  51.                                         transparency 0.7
  52.                                 }
  53.                         }
  54.                 }
  55.                 ]
  56.         }
  57.         ]
  58. }
  59.  
  60. # put a car on the other side of the window.
  61. Transform{
  62.         translation 0 0 -8
  63.         rotation 0 1 0 0.75
  64.         children[
  65.         Inline{url "CarBody.wrl"}
  66.         ]
  67. }
  68.